import request from "@/router/axios";

//获取需求单列表
export const getList = (current, size, params) => {
  return request({
    url: "/api/blade-tms/demandorder/DemandList/list",
    method: "get",
    params: {
      ...params,
      current,
      size,
    },
  });
};
//获取需求单详情
export const getDetail = (params) => {
  return request({
    url: "/api/blade-tms/demandorder/DemandList/detail",
    method: "get",
    params: {
      ...params,
    },
  });
};
//获取司机车辆押运员列表
export const getDriverCarEscortList = (params) => {
  return request({
    url: "/api/blade-tms/demandorder/DemandList/driverCarEscortList",
    method: "get",
    params: {
      ...params,
    },
  });
};
//修改需求单
export const demandUpdate = (data) => {
  return request({
    url: "/api/blade-tms/demandorder/update",
    method: "post",
    data: {
      ...data,
    },
  });
};
//分配运单
export const update = (data) => {
  return request({
    url: "/api/blade-tms/demandorder/DemandList/allocatingWaybill",
    method: "post",
    data: {
      ...data,
    },
  });
};
//修改运单
export const transportUpdate = (data) => {
  return request({
    url: "/api/blade-tms/transportorder/TransportList/update",
    method: "post",
    data: {
      ...data,
    },
  });
};
//获取运输单列表
export const getTransportList = (current, size, params) => {
  return request({
    url: "/api/blade-tms/transportorder/TransportList/list",
    method: "get",
    params: {
      ...params,
      current,
      size,
    },
  });
};
//获取运输单详情
export const getTransportDetail = (params) => {
  return request({
    url: "/api/blade-tms/transportorder/TransportList/detail",
    method: "get",
    params: {
      ...params,
    },
  });
};
//运单状态变更
export const waybillStatusChange = (data) => {
  return request({
    url: "/api/blade-tms/transportorder/TransportList/waybillStatusChange",
    method: "post",
    data: {
      ...data,
    },
  });
};
//签收
export const signForReceipt = (data) => {
  return request({
    url: "/api/blade-tms/transportorder/TransportList/signForReceipt",
    method: "post",
    data: {
      ...data,
    },
  });
};
//获取补全信息详情
export const getCompletionInfo = (params) => {
  return request({
    url: "/api/blade-tms/demand/extra/view",
    method: "get",
    params: {
      ...params,
    },
  });
};
//补全信息提交
export const submitCompletionInfo = (data) => {
  return request({
    url: "/api/blade-tms/demand/extra/fill",
    method: "post",
    data: {
      ...data,
    },
  });
};
//需求单事件变更
export const demandExtraEvent = (data) => {
  return request({
    url: "/api/blade-tms/demand/extra/event",
    method: "post",
    data: {
      ...data,
    },
  });
};
//异常费用列表
export const getExtraordinaryFee = (params) => {
  return request({
    url: "/api/blade-tms/exceptionCost/ExtraordinaryFee/list",
    method: "get",
    params: {
      ...params,
    },
  });
};
//新增或修改异常费用
export const extraordinaryFeeSaveOrUpdate = (data) => {
  return request({
    url: "/api/blade-tms/exceptionCost/ExtraordinaryFee/saveOrUpdate",
    method: "post",
    data: {
      ...data,
    },
  });
};
//删除异常费用
export const extraordinaryFeeRemove = (ids) => {
  return request({
    url: "/api/blade-tms/exceptionCost/ExtraordinaryFee/remove?ids=" + ids,
    method: "post",
  });
};
//提交异常费用
export const extraordinaryFeeSubmit = (data) => {
  return request({
    url: "/api/blade-tms/exceptionCost/ExtraordinaryFee/submit",
    method: "post",
    data: {
      ...data,
    },
  });
};
//查询运单轨迹URL
export const queryTheTrackOfTheWaybill = (params) => {
  return request({
    url: "/api/blade-tms/transportorder/TransportList/queryTheTrackOfTheWaybill",
    method: "get",
    params: {
      ...params,
    },
  });
};
//罐箱类型
export const getTankType = () => {
  return request({
    url: "/api/blade-tms/common/SelectEnum?name=tank",
    method: "get",
  });
};
//地址管理url
export const addressManagement = (params) => {
  return request({
    url: "/api/blade-tms/transportorder/TransportList/addressManagement",
    method: "get",
    params: {
      ...params,
    },
  });
};
//运输单补全信息提交
export const submitTransportCompletionInfo = (data) => {
  return request({
    url: "/api/blade-tms/transportorder/TransportList/fillTransport",
    method: "post",
    data: {
      ...data,
    },
  });
};
//运单是否支持拆单
export const waybillSupportsSplitting = (params) => {
  return request({
    url: "/api/blade-tms/systemConfig/waybillSupportsSplitting",
    method: "get",
    params: {
      ...params,
    },
  });
};
//路径规划url
export const getRoadBook = (params) => {
  return request({
    url: "/api/blade-tms/transportorder/TransportList/roadBook",
    method: "get",
    params: {
      ...params,
    },
  });
};
//修改运单异常拆单状态
export const updateStart = (id, start) => {
  return request({
    url: "/api/blade-tms/transportorder/TransportList/updateStart",
    method: "post",
    params: {
      id,
      start,
    },
  });
};
//运输单作废
export const transportToVoid = (data) => {
  return request({
    url: "/api/blade-tms/transportorder/Waybill/invalid",
    method: "post",
    data: {
      ...data,
    },
  });
};
//需求单作废
export const demandorderToVoid = (data) => {
  return request({
    url: "/api/blade-tms/demandorder/DemandList/invalid",
    method: "post",
    data: {
      ...data,
    },
  });
};
//修改签收信息
export const signForReceiptUpdate = (data) => {
  return request({
    url: "/api/blade-tms/transportorder/TransportList/signForReceiptUpdate",
    method: "post",
    data: {
      ...data,
    },
  });
};
